﻿using System;
using Comdiv.QWeb.Factory;

namespace Comdiv.QWeb.Binding {
	public class BindException : Exception {
		private readonly ActionDescriptor _action;
		private readonly BindAttribute _bindInfo;
		private readonly QWebContext _context;
		private readonly object _val;

		public BindException(BindAttribute bindInfo, QWebContext context, ActionDescriptor action, object val)
			: base(bindInfo.ErrorMessage) {
			_bindInfo = bindInfo;
			_context = context;
			_action = action;
			_val = val;
		}

		public BindAttribute BindInfo {
			get { return _bindInfo; }
		}

		public QWebContext Context {
			get { return _context; }
		}

		public ActionDescriptor Action {
			get { return _action; }
		}

		public object Val {
			get { return _val; }
		}
	}
}